package cn.edu.nuc.creditSystem.controller.user;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.nuc.creditSystem.bean.user.Menu;
import cn.edu.nuc.creditSystem.controller.BaseController;
import cn.edu.nuc.creditSystem.service.BaseService;
import cn.edu.nuc.creditSystem.service.user.service.MenuService;

@Controller
@RequestMapping("/cs/user/Menu")
public class MenuController extends BaseController<Menu>{
	@Autowired
	private MenuService ms;
	@Override
	protected BaseService<Menu> getService() {
		return ms;
	}

	@Override
	protected String getPrefix() {
		return "/menu/";
	}
	@RequestMapping("/Fmenu")
	@ResponseBody
	private List<Menu> getFMenu(Menu query){
		if(query==null){query=new Menu();}
		query.setPid(-1);
		return ms.query(query, null);
	}
}
